package bit_z

import (
	"github.com/parnurzeal/gorequest"
	"fmt"
	"global/constants"
)

type base struct {

}

func (*base) get(url string, params map[string]interface{}) (body string, err error) {
	c := gorequest.New()
	_, body, errs := c.Get(url).
		Set("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36").
		Query(params).
		End()
	if len(errs) > 0 {
		err = errs[0]
		return
	}
	return
}

func (*base) url(uri string) string {
	return fmt.Sprintf("%s/Market/%s", constants.BitzHttpBaseUrl, uri)
}